The TextField Component > FTextField.setIcon() |
FTextField.setIcon()
Availability
Flash Player 6.
Usage
myTextField_txf.setIcon (linkage)
Parameters
linkage A String specifying the linkage id of the symbol that
should be used as the icon in the component.
Returns
Nothing
Description
This method takes a String which specifies the linkage id of the symbol that should be used as the icon in the component. This allows you to easily display custom icons within the component. There are four icons included with the component:
ftf_errorIcon |
Error Icon |
ftf_infoIcon |
Info Icon |
ftf_warningIcon |
Warning Icon |
ftf_questionIcon |
Question Icon |
Notes
You must set Show Icon in the Property Inspector to true, or call the showIcon method, in order for the icon to be visible.
Example
The text_validation.fla example file contains an example of using this method.
The following code assigns an icon to the textfield and then shows it.
myTextField_txf.setIcon("ftf_errorIcon");
myTextField_txf.showIcon(true);
See also